<html>
<head><meta charset="utf-8"><title>meeting 2020.11.03 · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html">meeting 2020.11.03</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215486127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215486127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215486127">(Nov 03 2020 at 17:34)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="1172">@WG-async-foundations</span> meeting in 26 minutes</p>



<a name="215489890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215489890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lucio Franco <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215489890">(Nov 03 2020 at 18:02)</a>:</h4>
<p>I can't stay for long today, but hey everyone! <span class="user-mention" data-user-id="248777">@Bhargav Voleti</span> and I have not made much progress on the RFC vacation + work has been busy. Hoping to get back to it very soon. Beyond that I don't have any other updates. Have a good week everyone!</p>



<a name="215489978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215489978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215489978">(Nov 03 2020 at 18:03)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="1172">@WG-async-foundations</span> okay, let's get started</p>



<a name="215490061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490061">(Nov 03 2020 at 18:03)</a>:</h4>
<p><a href="https://github.com/orgs/rust-lang/projects/2">Project board</a></p>



<a name="215490159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490159">(Nov 03 2020 at 18:04)</a>:</h4>
<p>2 things got done/fixed this week:</p>
<ul>
<li>Hard to read error message with 2D line drawing and multi-line expressions <a href="https://github.com/rust-lang/rust/issues/70935">#70935</a></li>
<li>Add section on async ecosystem <a href="https://github.com/rust-lang/async-book/issues/104">async-book#104</a></li>
</ul>



<a name="215490253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490253">(Nov 03 2020 at 18:05)</a>:</h4>
<p>/me wonders if anyone is actually around today :)</p>



<a name="215490409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490409">(Nov 03 2020 at 18:06)</a>:</h4>
<p>in any case I'll do some triage here, quite a big backlog of new issues</p>



<a name="215490440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490440">(Nov 03 2020 at 18:06)</a>:</h4>
<p><a href="https://github.com/search?q=org%3Arust-lang+is%3Aissue+label%3AA-async-await+is%3Aopen+-label%3AAsyncAwait-Triaged&amp;type=Issues">Untriaged issues</a></p>



<a name="215490523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490523">(Nov 03 2020 at 18:07)</a>:</h4>
<h2>ICE: compiler/rustc_typeck/src/check/closure.rs:608:18: async fn generator return type not an inference variable <a href="https://github.com/rust-lang/rust/issues/78654">#78654</a></h2>



<a name="215490711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490711">(Nov 03 2020 at 18:08)</a>:</h4>
<p>hmm</p>



<a name="215490723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490723">(Nov 03 2020 at 18:09)</a>:</h4>
<p>I wonder if this is related to the edition 2015?</p>



<a name="215490790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490790">(Nov 03 2020 at 18:09)</a>:</h4>
<p>seems to reproduce on 2018</p>



<a name="215490913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490913">(Nov 03 2020 at 18:10)</a>:</h4>
<p>huh</p>



<a name="215490942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490942">(Nov 03 2020 at 18:10)</a>:</h4>
<p>I would guess that</p>



<a name="215490948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490948">(Nov 03 2020 at 18:10)</a>:</h4>
<p>the return type is a <code>Ty::Err</code></p>



<a name="215490949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490949">(Nov 03 2020 at 18:10)</a>:</h4>
<p>yeah it's odd</p>



<a name="215490960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490960">(Nov 03 2020 at 18:11)</a>:</h4>
<p>ah</p>



<a name="215490969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215490969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215490969">(Nov 03 2020 at 18:11)</a>:</h4>
<p>probably an easy fix</p>



<a name="215491027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491027">(Nov 03 2020 at 18:11)</a>:</h4>
<p>do you want to add a comment about that?</p>



<a name="215491036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491036">(Nov 03 2020 at 18:11)</a>:</h4>
<p>marking on deck</p>



<a name="215491048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491048">(Nov 03 2020 at 18:11)</a>:</h4>
<p>sure</p>



<a name="215491158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491158">(Nov 03 2020 at 18:12)</a>:</h4>
<p>next up is</p>



<a name="215491161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491161">(Nov 03 2020 at 18:12)</a>:</h4>
<h2>error[E0391]: cycle detected when computing type of async fn <a href="https://github.com/rust-lang/rust/issues/78649">#78649</a></h2>



<a name="215491382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491382">(Nov 03 2020 at 18:14)</a>:</h4>
<p>cycle errors, my favorite</p>



<a name="215491510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491510">(Nov 03 2020 at 18:15)</a>:</h4>
<p>I can see how this would result in a cycle, it seems like it needs to check that the return type of <code>foo</code> is <code>Send</code></p>



<a name="215491511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491511">(Nov 03 2020 at 18:15)</a>:</h4>
<p>yeah..</p>



<a name="215491530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491530">(Nov 03 2020 at 18:15)</a>:</h4>
<p>while type checking <code>foo</code> itself</p>



<a name="215491538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491538">(Nov 03 2020 at 18:15)</a>:</h4>
<p>this is sort of expected behavior</p>



<a name="215491542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491542">(Nov 03 2020 at 18:15)</a>:</h4>
<p>but I don't see why that doesn't happen with <code>Box</code></p>



<a name="215491544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491544">(Nov 03 2020 at 18:15)</a>:</h4>
<p>for better or worse</p>



<a name="215491616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491616">(Nov 03 2020 at 18:16)</a>:</h4>
<p>oh hmm</p>



<a name="215491636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491636">(Nov 03 2020 at 18:16)</a>:</h4>
<p>(maybe we're special casing Box somewhere?)</p>



<a name="215491687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491687">(Nov 03 2020 at 18:17)</a>:</h4>
<p>ah well</p>



<a name="215491702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491702">(Nov 03 2020 at 18:17)</a>:</h4>
<p>if you look at the signature of <code>FutureExt::Boxed</code>...</p>



<a name="215491715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491715">(Nov 03 2020 at 18:17)</a>:</h4>
<p><code>fn boxed&lt;'a&gt;(self) -&gt; Pin&lt;Box&lt;dyn Future&lt;Output = Self::Output&gt; + 'a + Send&gt;&gt;</code></p>



<a name="215491723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491723">(Nov 03 2020 at 18:17)</a>:</h4>
<p>it does require <code>Self::Output</code></p>



<a name="215491729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491729">(Nov 03 2020 at 18:17)</a>:</h4>
<p>yeah that's where I was going :)</p>



<a name="215491749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491749">(Nov 03 2020 at 18:17)</a>:</h4>
<p>I don't think <code>Box</code> is special-cased</p>



<a name="215491758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491758">(Nov 03 2020 at 18:17)</a>:</h4>
<p>but maybe it just winds up never demanding the return type somehow</p>



<a name="215491886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491886">(Nov 03 2020 at 18:18)</a>:</h4>
<p>this is definitely super annoying</p>



<a name="215491900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491900">(Nov 03 2020 at 18:18)</a>:</h4>
<p>I guess it can be inferred as <code>Box&lt;{{opaque}}&gt;</code> essentially?</p>



<a name="215491915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491915">(Nov 03 2020 at 18:19)</a>:</h4>
<p>and i'm not 100% sure why it can't be handled well :) it seems like it could</p>



<a name="215491954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491954">(Nov 03 2020 at 18:19)</a>:</h4>
<p>in particular the <code>Output</code> from the generator type is kind of known</p>



<a name="215491982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215491982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215491982">(Nov 03 2020 at 18:19)</a>:</h4>
<p>but i'm not sure how easy it will be to figure out the right path</p>



<a name="215492162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492162">(Nov 03 2020 at 18:21)</a>:</h4>
<p>okay, I'd say this is somewhat important but requires some real type checker spelunking</p>



<a name="215492262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492262">(Nov 03 2020 at 18:22)</a>:</h4>
<p>I'll add a comment</p>



<a name="215492349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492349">(Nov 03 2020 at 18:22)</a>:</h4>
<p>next up will be</p>
<h2>Variables not always moved into <code>async move</code> block <a href="https://github.com/rust-lang/rust/issues/78633">#78633</a></h2>



<a name="215492407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492407">(Nov 03 2020 at 18:23)</a>:</h4>
<p>oh actually on the last one</p>



<a name="215492435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492435">(Nov 03 2020 at 18:23)</a>:</h4>
<p>now that I'm writing it out, I'm seeing that <code>Self::Output</code> is clearly just <code>()</code></p>



<a name="215492455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492455">(Nov 03 2020 at 18:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03/near/215491954">said</a>:</p>
<blockquote>
<p>in particular the <code>Output</code> from the generator type is kind of known</p>
</blockquote>
<p>that is what I meant by this</p>



<a name="215492472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492472">(Nov 03 2020 at 18:24)</a>:</h4>
<p>right</p>



<a name="215492545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492545">(Nov 03 2020 at 18:24)</a>:</h4>
<p>it's a bit hard to say without more digging just <em>where</em> the cycle triggers and how hard it will be to avoid</p>



<a name="215492548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492548">(Nov 03 2020 at 18:24)</a>:</h4>
<p>so is it trying to make sure the function body is well-formed, essentially, before figuring out its return type?</p>



<a name="215492733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492733">(Nov 03 2020 at 18:26)</a>:</h4>
<p>okay, commented. not sure how to prioritize this one, but in an ideal world we'd be finding a way to fix it</p>



<a name="215492744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492744">(Nov 03 2020 at 18:26)</a>:</h4>
<p>I think I'll throw it on deck for now</p>



<a name="215492794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492794">(Nov 03 2020 at 18:26)</a>:</h4>
<p>okay, on to <a href="https://github.com/rust-lang/rust/issues/78633">#78633</a></p>



<a name="215492795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215492795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215492795">(Nov 03 2020 at 18:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116883">tmandry</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03/near/215492548">said</a>:</p>
<blockquote>
<p>so is it trying to make sure the function body is well-formed, essentially, before figuring out its return type?</p>
</blockquote>
<p>I guess?</p>



<a name="215493171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493171">(Nov 03 2020 at 18:29)</a>:</h4>
<p>^ added that theory to my comment</p>



<a name="215493225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493225">(Nov 03 2020 at 18:30)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/78633">#78633</a> involves capture semantics of <code>async move</code> blocks. are those subtly different from closures somehow?</p>



<a name="215493416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493416">(Nov 03 2020 at 18:31)</a>:</h4>
<p>oh, reading the comments more</p>



<a name="215493524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493524">(Nov 03 2020 at 18:32)</a>:</h4>
<p>er, yeah, my understanding remains the same</p>



<a name="215493553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493553">(Nov 03 2020 at 18:32)</a>:</h4>
<p>(sorry, I had to drop off)</p>



<a name="215493560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493560">(Nov 03 2020 at 18:32)</a>:</h4>
<p>it looks like with <code>arena</code> is being treated like a temporary somehow</p>



<a name="215493872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493872">(Nov 03 2020 at 18:35)</a>:</h4>
<p>sorry, looks like <code>track</code> is the issue</p>



<a name="215493935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215493935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215493935">(Nov 03 2020 at 18:35)</a>:</h4>
<p>essentially</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">async</span><span class="w"> </span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">arena</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">track</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="k">async</span><span class="w"> </span><span class="k">move</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">track</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="o">&amp;</span><span class="n">arena</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">.</span><span class="k">await</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>doesn't compile, but</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">async</span><span class="w"> </span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">arena</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">track</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="k">async</span><span class="w"> </span><span class="k">move</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">track</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">track</span><span class="p">;</span><span class="w">  </span><span class="c1">// &lt;-- added</span>
<span class="w">        </span><span class="n">track</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="o">&amp;</span><span class="n">arena</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">.</span><span class="k">await</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>does</p>



<a name="215494124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494124">(Nov 03 2020 at 18:37)</a>:</h4>
<p>oh I think I see what's going on</p>



<a name="215494157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494157">(Nov 03 2020 at 18:37)</a>:</h4>
<p>this is how closures work too</p>



<a name="215494198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494198">(Nov 03 2020 at 18:37)</a>:</h4>
<p>I think</p>



<a name="215494275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494275">(Nov 03 2020 at 18:38)</a>:</h4>
<p><code>track</code> in the first example is being captured as a mutable reference, because that's how it's used</p>



<a name="215494579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494579">(Nov 03 2020 at 18:40)</a>:</h4>
<p>yeah so this non-async example shows the same thing</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">arena</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">track</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="k">move</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="c1">//let mut track = track;</span>
<span class="w">        </span><span class="n">track</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="o">&amp;</span><span class="n">arena</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">})();</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>but the error message is different</p>



<a name="215494654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494654">(Nov 03 2020 at 18:41)</a>:</h4>
<p>non-async case:</p>
<div class="codehilite"><pre><span></span><code>error[E0521]: borrowed data escapes outside of closure
 --&gt; src/main.rs:9:9
  |
6 |     let mut track = Vec::new();
  |         --------- `track` declared here, outside of the closure body
...
9 |         track.push(&amp;arena)
  |         ^^^^^^^^^^^^^^^^^^
</code></pre></div>
<p>async case:</p>
<div class="codehilite"><pre><span></span><code>error[E0597]: `arena` does not live long enough
  --&gt; src/main.rs:10:20
   |
7  |     let mut track = Vec::new();
   |         --------- lifetime `&#39;1` appears in the type of `track`
...
10 |         track.push(&amp;arena)
   |         -----------^^^^^^-
   |         |          |
   |         |          borrowed value does not live long enough
   |         argument requires that `arena` is borrowed for `&#39;1`
11 |     }
   |     - `arena` dropped here while still borrowed
</code></pre></div>



<a name="215494863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494863">(Nov 03 2020 at 18:43)</a>:</h4>
<p>definitely not sure I understand what's going on in the async error</p>



<a name="215494888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215494888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215494888">(Nov 03 2020 at 18:43)</a>:</h4>
<p>side note, I think this is a pretty confusing aspect of how captures work in general</p>



<a name="215495228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495228">(Nov 03 2020 at 18:46)</a>:</h4>
<p>honestly, I think both error messages are bad</p>



<a name="215495249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495249">(Nov 03 2020 at 18:46)</a>:</h4>
<p>and I don't quite understand why removing <code>move</code> on the examples allows it to compile</p>



<a name="215495469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495469">(Nov 03 2020 at 18:48)</a>:</h4>
<p>I can explain :)</p>



<a name="215495523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495523">(Nov 03 2020 at 18:49)</a>:</h4>
<p>both errors are correct but subtle</p>



<a name="215495854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495854">(Nov 03 2020 at 18:52)</a>:</h4>
<p>OH, <code>track.push(&amp;arena)</code> is actually pushing a reference onto <code>track</code></p>



<a name="215495894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495894">(Nov 03 2020 at 18:52)</a>:</h4>
<p>right</p>



<a name="215495918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495918">(Nov 03 2020 at 18:52)</a>:</h4>
<p>and in the <code>move</code> case the data is owned by the closure/generator</p>



<a name="215495931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495931">(Nov 03 2020 at 18:53)</a>:</h4>
<p>right right</p>



<a name="215495933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215495933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215495933">(Nov 03 2020 at 18:53)</a>:</h4>
<p>but in the other case, it remains owned by the enclosing stack frame</p>



<a name="215496043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496043">(Nov 03 2020 at 18:54)</a>:</h4>
<p>left a comment</p>



<a name="215496054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496054">(Nov 03 2020 at 18:54)</a>:</h4>
<p>ok and <code>&amp;arena</code> appearing in a <code>move</code> closure captures <code>arena</code> by value, but <code>track.push(...)</code> only captures <code>track</code> by mutable reference</p>



<a name="215496080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496080">(Nov 03 2020 at 18:54)</a>:</h4>
<p>well</p>



<a name="215496090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496090">(Nov 03 2020 at 18:54)</a>:</h4>
<p><code>track</code> is also owned by the clsoure</p>



<a name="215496108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496108">(Nov 03 2020 at 18:54)</a>:</h4>
<p>but regardless it'd be a self-referential struct</p>



<a name="215496143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496143">(Nov 03 2020 at 18:55)</a>:</h4>
<p>ah ok, that makes more sense</p>



<a name="215496144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496144">(Nov 03 2020 at 18:55)</a>:</h4>
<p>i.e., if you think about it the struct would be like <code>struct Generator { arena: u32, track: Vec&lt;&amp;u32&gt; }</code> where <code>track</code> holds a reference to <code>arena</code></p>



<a name="215496241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496241">(Nov 03 2020 at 18:55)</a>:</h4>
<p>I guess the fact that it's pin might mean it could <em>theoretically</em> work maybe</p>



<a name="215496250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496250">(Nov 03 2020 at 18:56)</a>:</h4>
<p>but we'd need some fancier logic</p>



<a name="215496329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496329">(Nov 03 2020 at 18:56)</a>:</h4>
<p>right, I'm struggling to understand why you can't still do this</p>



<a name="215496375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496375">(Nov 03 2020 at 18:56)</a>:</h4>
<p>in the generator case</p>



<a name="215496467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496467">(Nov 03 2020 at 18:57)</a>:</h4>
<p>declaring those variables <em>inside</em> the generators certainly works</p>



<a name="215496586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496586">(Nov 03 2020 at 18:58)</a>:</h4>
<p>so I guess this comes down to how we handle captures, and the fact that that code is shared with closures</p>



<a name="215496866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496866">(Nov 03 2020 at 19:00)</a>:</h4>
<p>also, I still find the error message "borrowed data escapes outside of closure" kind of confusing</p>



<a name="215496901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496901">(Nov 03 2020 at 19:00)</a>:</h4>
<p>it sounds like what it's trying to say is, this creates a closure object which borrows itself</p>



<a name="215496931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215496931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215496931">(Nov 03 2020 at 19:00)</a>:</h4>
<p>but when I hear "escapes outside of closure" I tend to think of what the closure returns</p>



<a name="215497703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215497703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215497703">(Nov 03 2020 at 19:07)</a>:</h4>
<p>okay, we only got through 3 issues but it's been literally twice the scheduled length of the meeting, so I'm going to call it for now ;)</p>



<a name="215497722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215497722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215497722">(Nov 03 2020 at 19:07)</a>:</h4>
<p>that's progress, at least</p>



<a name="215497791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/meeting%202020.11.03/near/215497791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/meeting.202020.2E11.2E03.html#215497791">(Nov 03 2020 at 19:08)</a>:</h4>
<p>I might come back to do some more triage in a bit</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>